//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2003 Intrinsyc Europe Ltd.
//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004 Siemens AG
//
// Version: 1.09
// Date:    14. July 2004
//////////////////////////////////////////////////////////////////////////////

#pragma once

class CSerialAbstraction {
public:
  virtual BOOL VirtRead(void* pBuf, const UINT cb, DWORD& rdwRead) const = 0;
  virtual BOOL VirtWrite(const void* pBuf, const UINT cb, DWORD& rdwWritten) const = 0;
  virtual BOOL VirtWaitCommEvent(DWORD* const pdwMask) const = 0;
  virtual BOOL VirtClearCommBreak() const = 0;
  virtual BOOL VirtClearCommError(DWORD* const pdwErrors, COMSTAT* const pcs) const = 0;
  virtual BOOL VirtEscapeCommFunction(const DWORD dwFunc) const = 0;
  virtual BOOL VirtGetCommMask(DWORD* const pdwMask) const = 0;
  virtual BOOL VirtSetCommMask(const DWORD dwMask) const = 0;
  virtual BOOL VirtGetCommModemStatus(DWORD* const pdwStatus) const = 0;
  virtual BOOL VirtGetCommProperties(COMMPROP* const pcp) const = 0;
  virtual BOOL VirtGetCommState(DCB* const pdcb) const = 0;
  virtual BOOL VirtSetCommState(DCB* const pdcb) const = 0;
  virtual BOOL VirtGetCommTimeouts(COMMTIMEOUTS* const pct) const = 0;
  virtual BOOL VirtSetCommTimeouts(COMMTIMEOUTS* const pct) const = 0;
  virtual BOOL VirtPurgeComm(const DWORD dwFlags) const = 0;
  virtual BOOL VirtSetCommBreak() const = 0;
  virtual BOOL VirtSetupComm(const DWORD dwInQueue, const DWORD dwOutQueue) const = 0;
  virtual BOOL VirtTransmitCommChar(const char cChar) const = 0;
};

